# -*- coding: utf-8 -*-
import os
from datetime import datetime
from flask import Blueprint, g

from common import success_resp

health_bp = Blueprint('health', __name__)


@health_bp.get('/health')
def health():
    """Add some data

    ### args
    |  args | required | request type | type |  remarks |
    |-------|----------|--------------|------|----------|
    | title |  true    |    body      | str  | blog title    |
    | name  |  true    |    body      | str  | person's name |

    ### request
    ```json
    {"title": "xxx", "name": "xxx"}
    ```

    ### return
    ```json
    {"code": xxxx, "msg": "xxx", "data": null}
    ```
    """
    environ = os.getenv('FLASK_ENV')
    current_time = datetime.now()
    g.name = 'health'
    return success_resp({"now_time": current_time, 'service_name': "py.flask.excel", "environ": environ})
